package cn.harry.modular.sys.service.impl;

import cn.harry.modular.sys.mapper.SysRoleDeptMapper;
import cn.harry.modular.sys.domain.SysRoleDept;
import cn.harry.modular.sys.service.SysRoleDeptService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色部门关联
 *
 * @author honghh Date 2020-03-16 08:51:37 Copyright (C) www.tech-harry.cn
 */
@Service
public class SysRoleDeptServiceImpl extends ServiceImpl<SysRoleDeptMapper, SysRoleDept>
		implements SysRoleDeptService {

	@Override
	public boolean deleteRoleDeptByRoleId(Long roleId) {
		return remove(
				Wrappers.<SysRoleDept>lambdaQuery().eq(SysRoleDept::getRoleId, roleId));
	}

	@Override
	public List<Long> queryDeptIdList(List<Long> roleIdList) {
		return baseMapper.queryDeptIdList(roleIdList);
	}

}